package com.yyj.enums;/**
 * Created by Administrator on 2018/4/3.
 */

/**
 * @author leezp
 * @create 2018-04-03 11:09
 **/
public enum RepairRecordStatusEnum {

    /**
     * 待跟进
     */
    WAITING_FOLLOW("WAITING_FOLLOW", "待跟进"),

    /**
     * 已跟进
     */
    IS_FOLLOW("IS_FOLLOW", "已跟进"),

    /**
     * 已处理
     */
    IS_DEAL("IS_DEAL", "已处理"),

    /**
     * 未知
     */
    UNKNOWN("", "未知"),

    ;

    /**	标识		*/
    private String code ;

    /** 说明		*/
    private String desc ;

    private RepairRecordStatusEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据编码获取相应的类型
     * @param code
     * @return
     */
    public static RepairRecordStatusEnum getActivityCode(String code){
        if(code == null){
            return UNKNOWN;
        }
        for(RepairRecordStatusEnum one : RepairRecordStatusEnum.values()){
            if(code.equals(one.getCode())){
                return one;
            }
        }
        return RepairRecordStatusEnum.UNKNOWN;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "code : " + this.getCode() + "，desc : " + this.getDesc();
    }
}